package com.java.basis.thread;

import java.util.concurrent.locks.ReentrantLock;

public class TestLock {
    private static int count;
    private static ReentrantLock lock = new ReentrantLock();
    public static void main(String[] args) {
        lock.lock();
        try {
            count++;
            try {
                Thread.sleep(10);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        } finally {
            lock.unlock();
        }
    }
}
